# coding = utf-8

from django.urls import path
from rest_framework.routers import DefaultRouter

from .views import SaleOrderViewSet, SaleReceiptViewSet, SaleOrderDetailViewSet, SaleReceiptDetailViewSet, \
    SaleOrderListAPIView, SaleOrderDetailListAPIView, SaleBillAPIView, ReceivableAccountAPIView, ProfitAPIView, \
    SaleOrderCustomerAPIView

router = DefaultRouter()
# 后台
router.register(r'sale_order', SaleOrderViewSet, basename="api-sale-order")
router.register(r'sale_order_detail', SaleOrderDetailViewSet, basename="api-sale-order-detail")
router.register(r'sale_receipt', SaleReceiptViewSet, basename="api-sale-receipt")
router.register(r'sale_receipt_detail', SaleReceiptDetailViewSet, basename="api-sale-receipt-detail")

urlpatterns = [
    path('sale_order_list/', SaleOrderListAPIView.as_view(), name="api-sale-order-list"),
    path('sale_order_detail_list/', SaleOrderDetailListAPIView.as_view(), name="api-sale-order-detail-list"),
    path('sale_bill/', SaleBillAPIView.as_view(), name="api-sale-bill"),
    path('recv_account/', ReceivableAccountAPIView.as_view(), name="api-receivable-account"),
    path('profit/', ProfitAPIView.as_view(), name="api-profit"),
    path('sale_order_customer/', SaleOrderCustomerAPIView.as_view(), name="api-sale-order-customer"),
]
urlpatterns += router.urls
